#include "los_bitmap.h"

#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

//位设置
void  test_bitmapSetClr()
{
	int num = 0xaabbcc00;
	printf("num = %x\n",num);
	LOS_BitmapSet(&num,1);
	printf("num = %x\n",num);
    LOS_BitmapClr(&num,1);
	printf("num = %x\n",num);
	
}
//测试取出被设置的最低位和最高位
void test_bitmapLHSet()
{
	int num = 0x000000;
	printf("num = %x\n",num);
	LOS_BitmapSet(&num,1);
	printf("num = %x\n",num);
	LOS_BitmapSet(&num,5);
	printf("num = %x\n",num);
	
	UINT16 posL = LOS_LowBitGet(num);
	printf("posL = %d\n",posL);
	
	UINT16 posH = LOS_HighBitGet(num);
	printf("posH = %d\n",posH);
	
}
//Find the first zero bit starting from LSB
void test_bitmapFfz()
{
	int num = 0x110011;
	printf("num = %x\n",num);
	int index = LOS_BitmapFfz(&num,31);
	printf("index = %d\n",index);
}
int main()
{
	//test_bitmapSetClr();
	//test_bitmapLHSet();
	test_bitmapFfz();
	return 0;
}